<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>postMessage - b</title>
    <style>
        html,body {
            width: 100%;
            height: 100%;
            background-color: green;
        }
    </style>
</head>
<body>
    page b
    <script>
        window.addEventListener('message', function(e) {
            console.log("page b.", e.data);
            e.source.postMessage("嘿嘿", e.origin);
        }, false);
    </script>
</body>
</html>